package org.ihelpuoo.parser.segment;

import org.ihelpuoo.parser.StringTraveler;

/**
 * <b>SegmentNode class:</b>
 * <hr color=grey size=1>
 *
 *
 *
 * @author zozoh  created @ 2006
 *
 */
public abstract class SegmentNode
{

	private CharSegment	segment;
	protected Marks		marks;

	void setMarks(Marks marks)
	{
		this.marks = marks;
	}

	abstract void valueOf(StringTraveler st);

	MarkStack stack()
	{
		return getSegment().getMarkStack();
	}

	/**
	 * @return Returns the segment.
	 */
	CharSegment getSegment()
	{
		return segment;
	}

	/**
	 * @param segment The segment to set.
	 */
	void setSegment(CharSegment segment)
	{
		this.segment = segment;
	}

	abstract void clear();

	abstract CharSequence evaluate();

	protected abstract SegmentNode duplicate();

}
